package org.xdq;

import java.sql.*;
import java.util.UUID;

public class 普通索引 {

    static{
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
        } catch (ClassNotFoundException e) {
            throw new ExceptionInInitializerError(e);
        }
    }

    public static void main(String[] args) throws ClassNotFoundException, SQLException {


        int count = 1000;

        Connection conn =
                DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb3","root","root");

        conn.setAutoCommit(false);//设为手动提交事务，即开发者自定义事务边界

        String sql = "select * from emp where e_name = ?";
        PreparedStatement pst = conn.prepareStatement(sql);


        long start = System.currentTimeMillis();
        pst.setString(1, "403070175");
        ResultSet rs = pst.executeQuery();
        conn.commit();

        System.out.println("耗时："+(System.currentTimeMillis()-start));



        pst.close();
        conn.close();

    }



}
